\chapter{Imaginary Numbers and Euler}
When working with audio, there are some concepts that need to comprehended. However, the following doesn't really fit with the project itself, but it is still good to understand. Therefore it has been chosen to put this as an appendix.

\section{Imaginary Numbers}
The following section is based on \cite{imaginaryNumbers_india}. The same applies for all figures used.

The term \textit{imaginary number} was coined in the 17th century, but until recently it has been impossible to really explain what they mean. Depending on one's field of work, it is denoted either with a \textit{j} or an \textit{i}. This report will use the letter \textit{i} when talking about imaginary numbers. Just like the number zero, or in fact any negative number, it should be seen as a theoretical number that cannot be found in the real world.

When having something like $x^2= 9$, one can easily find the solution to be either 3 or -3. However, it seems counter-intuitive to find the solution to $x^2 = -9$. What number multiplied by itself can become a negative number?

This is where imaginary numbers come into the picture. Instead of seeing numbers in a single dimension, it can be expanded to use multiple dimensions.

$i^2$ is said to be $-1$. Also, $i = \sqrt(-1)$.

This is possible because we now work with a two-dimensional coordinate system, as shown in \ref{fig:rotateToOne}, where X is said to be the real numbers axis and Y the imaginary numbers axis. Here a transformation with $i$ can be seen as a rotation of 90 degrees. Doing this twice goes around half the circle (counter-clockwise), or $\pi$ radians, which ends up in point $(-1, 0i)$. One could also go the other way around by multiplying negative $-i$ to go -90 degrees, as shown in figure \ref{fig:positiveNegativeRotation}.

\begin{figure}[htbp] \centering
\begin{minipage}[b]{0.49\textwidth} \centering
\includegraphics[width=1\textwidth]{images/TheoryDesign/euler/imaginary_rotation} % Venstre billede
\end{minipage} \hfill
\begin{minipage}[b]{0.49\textwidth} \centering
\includegraphics[width=1\textwidth]{images/TheoryDesign/euler/positive_negative_rotation} % Højre billede
\end{minipage} \\ % Captions og labels
\begin{minipage}[t]{0.49\textwidth}
\caption{Imaginary numbers can be thought of as an extra axis.} % Venstre caption og label
\label{fig:rotateToOne}
\end{minipage} \hfill
\begin{minipage}[t]{0.49\textwidth}
\caption{Multiplying by $i$ goes 90 positive degrees; $-i$ goes 90 negative degrees.} % Højre caption og label
\label{fig:positiveNegativeRotation}
\end{minipage}
\end{figure}

The imaginary number $i$ will always evaluate to one of four possible results: $1$, $i$, $-1$ or $-i$. This is due to the number of times you can rotate 90 degrees to complete a cycle in the unit circle. Figure \ref{fig:imaginaryCycle} illustrates this principle, where each axis of the coordinate system has its own value. A more general notation for this pattern is closer to the original coordinate system and can be denoted this way: X = 1, Y = i, -X = -1 and -Y = -1. What it really says is (X = 1, Y = 0), (X = 0, Y = i) and so on, but since one of the coordinates evaluates to 0, it is left out of the notation. This means that imaginary numbers can model anything that rotates in two dimensions X and Y.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/TheoryDesign/euler/imaginary_cycle}
\caption{Image caption text goes here bla bla bla bla}
\label{fig:imaginaryCycle}
\end{figure}
  
\section{Complex Numbers}
One is not limited to either working with real numbers or imaginary numbers; it is possible to use both at the same time. This is called \textit{complex number}, because it consists of more than one thing is by definition then more complex than a single number.

Figure \ref{fig:onePlus} illustrates this concept. Since $i$ is the same as a rotation by 90 degrees; if one wants to rotate only half of that, say 45 degrees, both axes can be taken in use. This means that $1 + i$ will result in a line that has a angle of 45 degrees. This can be seen as having a foot in the real dimension and imaginary dimension at the same time. This can also be written as $a + bi$, where $b$ is the imaginary part (see figure \ref{fig:aPlusBi}).
Using Pythagoras theorem, one can find the magnitude of the line. That is, the size of $a + bi = \sqrt(a^2 + b^2)$.

\begin{figure}[htbp] \centering
\begin{minipage}[b]{0.45\textwidth} \centering
\includegraphics[width=0.60\textwidth]{images/TheoryDesign/euler/one_plus_i} % Venstre billede
\end{minipage} \hfill
\begin{minipage}[b]{0.45\textwidth} \centering
\includegraphics[width=0.60\textwidth]{images/TheoryDesign/euler/a_plus_bi} % Højre billede
\end{minipage} \\ % Captions og labels
\begin{minipage}[t]{0.45\textwidth}
\caption{blabla} % Venstre caption og label
\label{fig:onePlus}
\end{minipage} \hfill
\begin{minipage}[t]{0.45\textwidth}
\caption{Blabla} % Højre caption og label
\label{fig:aPlusBi}
\end{minipage}
\end{figure}

As an example for applying a set of complex numbers, imagine that a captain on a ship needs to find the heading to sail. He is heading 3 units East for every 4 units North, as illustrated in figure \ref{fig:sail1}. Now he decides to change his heading by 45 degrees counter-clockwise. To calculate his new direction, complex numbers can be used.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/TheoryDesign/euler/imaginary_example1}
\caption{Image caption text goes here bla bla bla bla}
\label{fig:sail1}
\end{figure}

The direction of the ship can be described as $3 + 4i$. Now this should be rotated by 45 degrees, which was shown previously to be $1 + i$. To get the result, one simply has to multiply these two complex numbers to get the new heading.

The formula can be written as $(a + bi) * (c + di)$
, where $a$ and $c$ are the real numbers $3$ and $1$, and $bi$ and $di$ are the imaginary numbers $4$ and $1$.

The result can be calculated with the following formula:
$(a + bi) * (c + di) = a(c + di) + bi(c + di)$

In this example it would be:
$(3 + 4i) * (1 + i) = 3 + 4i + 3i + 4i^2$

$= 3 + 7i + 4i^2$

Since $i^2 = -1$, then the result becomes $3 - 4 + 7i = -1 + 7i$. Figure \ref{fig:sail2} shows this.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/TheoryDesign/euler/imaginary_example2}
\caption{Image caption text goes here bla bla bla bla}
\label{fig:sail2}
\end{figure}

\section{Exponential Growth with $e$}
The following section is based on \cite{eGrowth_india} and \cite{eGrowth_purp}. The same goes for all figures used.

In mathematics, the constant $e$ is the base of the natural logarithm and describes the rate of growth shared by all continually growing processes. It is used whenever a system grows exponentially and continuously. An example of this could be a calculation of the population's growth in a country. 
$e$ has the approximate value of $2.7182$ and every rate of growth in a number is often described as a scaled version of $e$, exactly like you could say that a real number is a scaled version of the base unit $1$.

\textit{"So $e$ is not an obscure, seemingly random number. $e$ represents the idea that all continually growing systems are scaled versions of a common rate."} - Kalid Azad

Exponential growth is a term used for something that changes over e.g. time or a unit. For example if you've got $1$ dollar, and that $1$ dollar grows at a rate of $100\%$ every second, then you would have $2$ dollars after one second, $4$ dollars after two seconds, $8$ dollars after three seconds and so on. An example of this is illustrated in figure \ref{fig:expgrowth}, where the amount of "dots" are doubled for each unit of time.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/ExponentE/DoubleExpGrowth.png}
\caption{This figure illustrates the principle of exponential growth}
\label{fig:expgrowth}
\end{figure}

The mathematical equation for this example, with $100\%$ growth is:

$growth = 2^x$

where the number $2$ describes the amount of growth, in this case double = $100\%$, and $x$ describes the number of times it grows. So for this particular example the equation is $2^3 = 8$, which means that you would end up with $8$ times more dots, than the original $1$. 

The more general equation for exponential growth is:

$growth = (1 + return)^x$

where the $return$ is the amount of percent it grows and $x$ is the number of times it grows. So it starts out with $1$, then adds the percent of growth, and then returns that growth $x$ times. The example demonstrates a growth of a $100\%$, but this number could be any amount of growth ($25\%$, $50\%$ $250\%$ etc.).

Normally things wouldn't increase instantly at one point in time, but have a more graduate change over time. E.g.if you were to put $1$ dollar in a bank, and you were told that you would earn a $100\%$ interest every year, then the $100\%$ wouldn't just magically appear when exactly one year had passed. The money would instead probably increase on a monthly basis, where you would receive $1/12$ of the interest every month. The next month you would then get the next $1/12$ of the new balance (your $1$ dollar $+$ the interest from the first month), and this would continue until the year had passed. Figure\ref{fig:expgrowth} illustrates the principle of this(fictive numbers).

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/ExponentE/GradualGrowth.png}
\caption{This figure illustrates the principle of a gradual growth over time}
\label{fig:gradualgrowth}
\end{figure}

The equation for the above example would be:

$growth = (1 + 100\% / 12)^12 = (1 + 1/12)^12 = 2.6130$

which means that you would have earned $1.6130$ dollars in interest, besides from you the initial $1$ dollar, at the end of the year. 
All of the above examples are standard exponential equations, that are quite simple to comprehend. But if you were to repeat these equations with even smaller time windows (months, days, hours, minutes, seconds), but still with a $100\%$ interest rate, a pattern would repeat itself in the results. Even though the time slots would become smaller(thereby making the denominator and the exponent greater in the equation), the growth would be slowing down fast. Figure\ref{fig:tableofe} illustrates how the growth behaves when stretched over different time spans. All results tend to increase quite a lot in the beginning, but then suddenly slows down drastically. As seen in the last three equations, the growth approximately equals the same number starting with $2.7182$, which is also the approximate value of $e$ (like $\pi$, $e$ doesn't have a "finite" result).

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/ExponentE/TableOfE.png}
\caption{This figure illustrates what happens when the time span in the equation is decreased}
\label{fig:tableofe}
\end{figure}

All of this means that the maximum possible result, when increasing with a $100\%$ growth for one time period, is $e$ or $2.718$ (If you started with $1$ dollar, you would now have $2.718$ dollars). If you start with $1.00$ dollar and compound continuously with an interest of a $100\%$, the return is $1e$. If you do the same with $5$ dollars and an interest of a $100\%$, the return is $5e$. 
$e$ is a reference point, and although you might not reach the value of $e$, it tells you how fast you can possibly grow using a continuous process. On top of that, every rate of growth can be written in terms of $e$. It is important to note that $e$ is the final result and not the growth. The growth rate is called the "increase". So $1$ dollar becoming $e$($2.718$) is an increase of $171.8\%$, while $e$ is the result of the original dollar $+$ the interest earned.

So if $e$ is a reference point to the maximum possible result, the equation for finding the growth can be simplified to:

$growth = e^{rate}$

where the rate is the growth increase in percent. E.g. $e^1 = 2.718$ which means it is a $100\%$ increase as seen earlier. If it is $e^5 = 148.41$, the growth rate is $500\%$ and so on. Though this equation gives  the maximum possible result in growth, it doesn't include the time aspect seen in earlier examples. The time aspect is easily incorporated into the equation and is as follows:

$growth = e^{rate*time} = e^{r*t}$

$r*t$ is denoted as $x$, which means that the final equation for exponential growth, utilizing the natural logarithm $e$, is:

$growth = e^x = e^{r*t}$

An example of how this works:

If someone had a box containing a $100$ bacteria(if they could be measured as a unit), and the growth rate of these bacteria was a $100\%$ each day, then after e.g. $5$ days, the box would contain:

$100 * e^{(1 * 5)} = 14841.4$ bacteria. 

($100$ being the number of initial bacteria, $1$ being the $100\%$ growth as explained earlier and $5$ being the timespan).

So $e^x$ can help predict the impact of any growth rate and time period.


\subsection{Euler's Formula}
The following section is based on \cite{euler_india}. The same goes for all figures used.

Euler's identity is stated as:
\begin{align}
e^{i*\pi} = -1
\end{align}

It emerges from a more general formula that looks like this:
\begin{align}
e^{i * \pi} = cos(x) + i*sin(x)
\label{eq:euler_general}
\end{align}

It is used to describe movement in a circle using exponential growth. When talking about exponential growth with regular numbers, it is said to continuously being \textbf{increased} by some rate. When talking about imaginary growth, however, it is about exponential growth that that is continuously \textbf{rotating} a number.

Growing by $\pi$ means going $\pi$ radians around a circle. Therefore, $e^{i*\pi}$ is the same as starting at $1$ and rotating $\pi$ radians (180 degrees) to get to $-1$.

Regular growth is about numbers increasing. With Euler's formula and imaginary numbers, it is about rotating in a circle, say the unit circle. Figure \ref{fig:traverse} shows that this is the same as taking cosine to and angle and add sine multiplied by $i$ to make it traverse around the circle.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/TheoryDesign/euler/circle_traverse}
\caption{Image caption text goes here bla bla bla bla}
\label{fig:traverse}
\end{figure}

The right side of equation \ref{eq:euler_general} describes the circular motion with imaginary numbers. Then there is the left side, $e^{i * \pi}$, describes the imaginary growth. Regular growth "pushes" numbers in the same direction on the real axis. However, this is not the case with imaginary growth, since it is going in a different direction. Instead of going forward, it is pushing in an angle of 90 degrees. This constant perpendicular motion does not change the speed of the growth; instead it rotates it. This means that taking any number and multiplying it by $i$ does not change the number's magnitude, but instead the direction that it is pointing. This is shown in figure \ref{fig:imaginary_growth}.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/TheoryDesign/euler/imaginary_growth}
\caption{Image caption text goes here bla bla bla bla}
\label{fig:imaginary_growth}
\end{figure}

Taking a number such as $e^{ln(2)}$ means growing to $2$. By multiplying it with a number such as $x$, it means that $e^{ln(2)*x}$ grows at rate $ln(2)$ for $x$ seconds. The $x$ acts as a scaling value. If $x$ is $2$, it makes the growth go twice as fast - or, put in another way, for twice as much time.

Here, $e$ represents the process of starting at number $1$ and then growing in a continuous rate at 100\% for $1$ unit of time.

Having an imaginary growth rate $(R*i)$, this is the same as having $e^{R*i}$ that is imaginary and grows to $i$. Taking the double of that, i.e. $2*R*i$, won't go outside of the circle, but instead make the spinning rate double as fast/long. Increasing the rate will always make it spin faster, but still stay within the circle. Having continuous perpendicular growth rotates around a circle, as shown in figure \ref{fig:imaginary_interest}. Euler's formula is basically about taking exponential, imaginary growth that races out a circle. This is the same as moving in the circle using sine and cosine in the plane that is imaginary.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/TheoryDesign/euler/imaginary_interest}
\caption{Image caption text goes here bla bla bla bla}
\label{fig:imaginary_interest}
\end{figure}

Also, the growth rate can be that of a complex number, say $(a+bi)$. Here, the real part $a$ will grow like normal, and the imaginary part $bi$ will rotate it.

It is also possible to have real and imaginary growth simultaneously. This is shown in figure \ref{fig:complex_growth}, where the real portion is used for scaling, and the imaginary part is used to rotate around the circle. The real part, $a$, means that it should grow 100\% for $a$ seconds, while the imaginary part, $bi$, says that it should rotate for $b$ seconds.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/TheoryDesign/euler/complex_growth}
\caption{Image caption text goes here bla bla bla bla}
\label{fig:complex_growth}
\end{figure}

To sum up, there are basically two ways to describe the same: one uses Cartesian coordinates (go $3$ units right and $4$ units up), the other uses polar coordinates (go $5$ units at an angle of $71$ degrees). Euler's formula can be used to convert between the two, as shown in figure \ref{fig:equal_paths}.

\begin{figure}[htbp]
\centering
\includegraphics[width=0.50\textwidth]{images/TheoryDesign/euler/equal_paths}
\caption{Image caption text goes here bla bla bla bla}
\label{fig:equal_paths}
\end{figure}

\textbf{NEED TO WRITE SOMETHING THAT LEADS INTO ANGLE AND PHASE - Gustav 22 April}